#!/usr/bin/env bash

# 只启动一次jupter notebook
if  ps -C jupyter-notebook > /dev/null
then
    echo jupyter-notebook started already
    pid=$( ps -C jupyter-notebook -w 200|grep jupyter-notebook|awk '{print $1}' )
    echo jupyter-notebook pid is ${pid} 
    kill -9 ${pid}
    echo jupyter-notebook is killed 
fi

( cd "$HOME/jupyter_root"; jupyter notebook & ) > $HOME/logs/jupyter_notebook.log 2>&1
